package com.xianniu.ltc.enums;

import lombok.Getter;

/**
 * @author wangruijie
 * @version 1.0
 * @description: < 行业 >
 * @date 2021/5/27 19:32
 */
@Getter
public enum IndustryEnum {
    // 订单类型(1维保服务，2技术支持，3产品采购，4，驻场服务)
    I1("其他","019-017713595a020453"),
    I2("制造业","019-017713595a130454"),
    I3("咨询","019-017713595a230455"),
    I4("娱乐","019-017713595a340456"),
    I5("媒体","019-017713595a440457"),
    I6("政府","019-017713595a540458"),
    I7("教育","019-017713595a640459"),
    I8("服务","019-017713595a74045a"),
    I9("电信","019-017713595a84045b"),
    I10("能源","019-017713595a93045c"),
    I11("金融","019-017713595aa3045d"),
    I12("零售","019-017713595ab4045e"),
    I13("非盈利事业","019-017713595ac4045f"),
    I14("高科技","019-017713595ad50460");

    private String key;
    private String value;

    IndustryEnum(String key, String value){
        this.key=key;
        this.value=value;
    }
    /**
     * 自己定义一个静态方法,通过key返回枚举常量对象
     * @param key
     * @return
     */
    public static IndustryEnum getValue(String key){

        for (IndustryEnum color: values()) {
            if(color.getKey().equals(key)){
                return  color;
            }
        }
        return null;
    }

    /**
     * 自己定义一个静态方法,通过key返回枚举常量对象
     * @param value
     * @return
     */
    public static IndustryEnum getByValue(String value){

        for (IndustryEnum color: values()) {
            if(color.getValue().equals(value)){
                return  color;
            }
        }
        return null;
    }
}
